{% extends 'forum/base/main.html' %}
{% load widthtruncate %}
{% block main %}
<div id="index">
    <div id="index_l">
        <div id="boardlist_title">
        版块列表    
        </div>    
        {% regroup boards|dictsort:"category_id" by category as category_list %}
        {% for category in category_list %}
            <div class="board_category">
                {{ category.grouper.showname }}
            </div>
            {% for board in category.list %}
            <div class="board_item">
                <div class="board_item_name">
                    <a href="{% url "board" tboard=board.name %}">{{ board.showname }}({{ board.name }})</a>
                </div>
                <div class="board_item_discription">
                    {{ board.discription }}
                </div>
            </div>
            {% endfor %}
        {% endfor %}
    </div>
    <div id="index_r">
        <div class="hot_head">
            热点话题
        </div>        
        {% for post in posts %}
        <div class="hot_item">
            <a class="hot_item_board" href='{% url "board" tboard=post.board.name  %}'>{{ post.board.showname }}</a>
            <a class="hot_item_title" href='{% url "single_post" id=post.id %}'>{{ post.title|widthtruncate:40 }}</a>
            <span class="hot_item_info"><a class="hot_item_author" href=''>{{ post.author|default:"匿名" }}</a>·{{ post.post_time|date:"Y/m/d" }}</span>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock main %}
